cmake_minimum_required(VERSION 3.15)


project(130_project)
include_directories("${PROJECT_SOURCE_DIR}/app")
include_directories("${PROJECT_SOURCE_DIR}/device")
include_directories("${PROJECT_SOURCE_DIR}/slave")
include_directories("${PROJECT_SOURCE_DIR}/ipc")
include_directories("${PROJECT_SOURCE_DIR}/channel")
include_directories("${PROJECT_SOURCE_DIR}/data")
include_directories("${PROJECT_SOURCE_DIR}/util")
include_directories("${PROJECT_SOURCE_DIR}/thirdpart/libmodbus/src")
include_directories("${PROJECT_SOURCE_DIR}/thirdpart/libmodbus")
include_directories("${PROJECT_SOURCE_DIR}/thirdpart/sqlite")
include_directories("${PROJECT_SOURCE_DIR}/thirdpart/nlohmann/include")
include_directories("${PROJECT_SOURCE_DIR}/thirdpart/spdlog/include")

link_directories("${PROJECT_SOURCE_DIR}/device")
link_directories("${PROJECT_SOURCE_DIR}/slave")
link_directories("${PROJECT_SOURCE_DIR}/ipc")
link_directories("${PROJECT_SOURCE_DIR}/data")
link_directories("${PROJECT_SOURCE_DIR}/util")
link_directories("${PROJECT_SOURCE_DIR}/thirdpart/lib")
set(CMAKE_CXX_FLAGS "-std=c++11")
ADD_DEFINITIONS ("-DSQLITE_THREADSAFE=1")
ADD_DEFINITIONS ("-D__LINUX__")
ADD_DEFINITIONS ("-D_GNU_SOURCE")
ADD_DEFINITIONS ("-D_LARGEFILE_SOURCE")
ADD_DEFINITIONS ("-D_FILE_OFFSET_BITS=64")
ADD_DEFINITIONS ("-DBITSFLOW_MAJOR=2")
ADD_DEFINITIONS ("-DBITSFLOW_MINOR=25")
ADD_DEFINITIONS ("-DBITSFLOW_MAINTENANCE=18")
ADD_DEFINITIONS ("-DBITSFLOW_APPEND=2")
ADD_DEFINITIONS ("-D_GLIBCXX_USE_CXX11_ABI=0")

add_subdirectory(device)
add_subdirectory(slave)
add_subdirectory(ipc)
add_subdirectory(app)
add_subdirectory(data)
add_subdirectory(util)
add_subdirectory(channel)